package util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;


public class DateUtil {

	
	public static Date getDate(String string){
		Date date = new Date();
		SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
		try {
			date = formatter.parse(string);
		} catch (ParseException e) {
			e.printStackTrace();
			return null;
		}
		return date;
	}
	
	public static String getString(Date laDate){
				
		Date maintenant = laDate; 
		SimpleDateFormat formatDateJour = new SimpleDateFormat("dd/MM/yyyy kk:mm:ss"); 
		String dateFormatee = formatDateJour.format(maintenant); 
		String sDate = dateFormatee.split(" ")[0];
		
		return sDate;
	}

}
